package com.autoTools.view;

import java.awt.Choice;
import java.awt.PopupMenu;

import com.autoTools.util.LogUtil;
public class ChoiceView extends BaseView
{
	private Choice mChoice = null;

	public ChoiceView()
	{
		mChoice = new Choice();
		mChoice.setEnabled(true);
		mChoice.setVisible(true);
//		mChoice.add("item1");
//		mChoice.add("item2");
//		mChoice.add("item3");
//		mChoice.addItem("item1");
//		mChoice.addItem("item2");
//		mChoice.addItem("item3");
		BaseInit(mChoice);
	}

	public void addItem(Object child){
		if(child != null){
			if(child instanceof PopupMenu){
				mChoice.add((PopupMenu)child);
			}else if(child instanceof String){
				mChoice.add(child.toString());
			}
		}
	}
	
	public boolean addChild(BaseView child)
	{
		boolean state = false;
		LogUtil.sysLog(TAG, "addChild Error:child is not extends Component");
		return state;
	}
	
}
